package com.example.service.impl;

import com.example.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class HelloServiceImpl implements HelloService {
    Random random = new Random();
    @Override
    public String methodA() {
        try {
            Thread.sleep(getRandomNum());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "this is methodA";
    }

    @Override
    public String methodB() {
        try {
            Thread.sleep(getRandomNum());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "this is methodB";
    }

    @Override
    public String methodC() {
        try {
            Thread.sleep(getRandomNum());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "this is methodC";
    }

    private int getRandomNum(){
        return random.nextInt(100);
    }
}
